package web_k;

import service_k.MainUserService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/mainUserModifyTotalServlet")
public class MainUserModifyTotalServlet extends HttpServlet {
    private MainUserService service = new MainUserService();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        float total = Float.parseFloat(request.getParameter("total"));

        service.modifyTotal(total);

        response.setContentType("text/html;charset=utf-8");
        response.getWriter().write("您已修改成功！");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
